import { request,requestFile } from "./request";

//图片上传

export function ImageUpload(tempFilePaths:string,cb:any=null){

    return requestFile({
        url:'/api/webapp/c/dev/file/uploadLocalReturnUrl',
        tempFilePaths,
        cb
    })
}

//获取对应的客服id值

export function getServicerId(type:string | null=null){
    return request({
        url:'/api/chatapp/client/c/kefu/chat/chatId',
        method:'GET',
        data:(type ? {type} : null)
    })
}

//获取用户的的信息



export function getCustomerInfo(): Promise<any>{
    return request({
        url:'/api/webapp/auth/c/getLoginUser',
        method:'GET',
    })
}


//获取聊天记录

export function getmessageHistory(userChatId:string,startId:string = '',size:number=8){
    return request({
        data:{startId,userChatId,size,sortField:'id',sortOrder:'DESCEND'},
        url:'/api/chatapp/chat/message/page',
        method:'GET',
    })
}